package com.swordxu.yim.android.config;

/**
 * Created by 徐晓明 on 2015/1/8.
 */
public class ProtocolConstant {
    //消息类型
//    public static final int MSG_TYPE_TEXT = 1;          //消息类型-文本
//    public static final int MSG_TYPE_IMG = 2;           //消息类型-图片
//
//    //commond id
//    //消息ID
//    public static final int CID_MSG_HIS_REQ = 1;        //历史消息请求
//    public static final int CID_MSG_HIS_REP = 2;        //历史消息响应
//    public static final int CID_MSG_DATA = 3;           //普通消息
//    //群消息commond id
//    public static final int CID_GROUP_LIST_REQ = 1;     //获取群组列表请求
//    public static final int CID_GROUP_LIST_RES = 2;     //获取群组列表响应
//    //好友commond id
//    public static final int CID_FRIEND_LIST_REQ = 1;    //好友列表请求
//    public static final int CID_FRIEND_LIST_RES = 2;    //好友列表响应
//    //登录/注册commond id
//    public static final int CID_LOGIN_REQ = 1;          //登录请求
//    public static final int CID_LOGIN_RES = 2;          //登录相应
//    public static final int CID_MSGSERVER_REQ = 3;      //获取消息服务器host请求
//    public static final int CID_MSGSERVER_RES = 4;      //获取消息服务器host响应
//    public static final int CID_REG_REQ = 5;            //注册请求
//    public static final int CID_REG_REP = 6;            //注册响应

    //service id
//    public static final int SID_LOGIN = 1;              //登录/注册
    public static final int SID_FRIEND_LIST = 2;        //获取好友列表
//    public static final int SID_GROUP = 3;              //群组
//    public static final int SID_MSG = 4;                //消息
//    public static final int SID_FILE = 5;               //发送文件

    // msg type
    public static final byte MSG_TYPE_P2P_FLAG = 0x00;
    public static final byte MSG_TYPE_GROUP_FLAG = 0x10;

    public static final byte MSG_TYPE_P2P_TEXT = MSG_TYPE_P2P_FLAG + 0x01;
    public static final byte MSG_TYPE_P2P_AUDIO = MSG_TYPE_P2P_FLAG + 0x02;
    public static final byte MSG_TYPE_GROUP_TEXT = MSG_TYPE_GROUP_FLAG + 0x01;
    public static final byte MSG_TYPE_GROUP_AUDIO = MSG_TYPE_GROUP_FLAG + 0x02;

    public static final int MESSAGE_TYPE_IM = 0x01; // 普通用户+系统消息
    public static final int MESSAGE_TYPE_IM_GROUP = 0x11;
    public static final int MESSAGE_TYPE_IM_AUDIO = 0x02;
    public static final int MESSAGE_TYPE_IM_GROUP_AUDIO = 0x12;

    public static final byte MSG_TYPE_GROUP_TEXT_FOR_HISTORY_REASON_COMPATIBILITY = 3;

    // command id for group message
    public static final int CID_GROUP_LIST_REQUEST = 1;
    public static final int CID_GROUP_LIST_RESPONSE = 2;
    public static final int CID_GROUP_USER_LIST_REQUEST = 3;
    public static final int CID_GROUP_USER_LIST_RESPONSE = 4;
    public static final int CID_GROUP_UNREAD_CNT_REQUEST = 5;
    public static final int CID_GROUP_UNREAD_CNT_RESPONSE = 6;
    public static final int CID_GROUP_UNREAD_MSG_REQUEST = 7;
    public static final int CID_GROUP_UNREAD_MSG_RESPONSE = 8;
    public static final int CID_GROUP_HISTORY_MSG_REQUEST = 9;
    public static final int CID_GROUP_HISTORY_MSG_RESPONSE = 10;
    public static final int CID_GROUP_MSG_READ_ACK = 11;
    public static final int CID_GROUP_CREATE_TMP_GROUP_REQUEST = 12;
    public static final int CID_GROUP_CREATE_TMP_GROUP_RESPONSE = 13;
    public static final int CID_GROUP_CHANGE_MEMBER_REQUEST = 14;
    public static final int CID_GROUP_CHANGE_MEMBER_RESPONSE = 15;
    public static final int CID_GROUP_DIALOG_LIST_REQUEST = 16;
    public static final int CID_GROUP_DIALOG_LIST_RESPONSE = 17;
    public static final int CID_GROUP_CREATE_NORMAL_GROUP_NOTIFY = 18;
    public static final int CID_GROUP_CHANGE_MEMEBER_NOTIFY = 19;
    public static final int CID_GROUP_MAX = 21;

    // command id for buddy list
    public static final int CID_BUDDY_LIST_REQUEST = 1; //
    public static final int CID_BUDDY_LIST_FRIEND_LIST = 3; //
    public static final int CID_BUDDY_LIST_ONLINE_FRIEND_LIST = 4; //
    public static final int CID_BUDDY_LIST_STATUS_NOTIFY = 5; //
    public static final int CID_BUDDY_LIST_USER_STATUS_REQUEST = 8; //
    public static final int CID_BUDDY_LIST_USER_STATUS_RESPONSE = 9; //
    public static final int CID_BUDDY_LIST_USER_INFO_RESPONSE = 10; //
    public static final int CID_BUDDY_LIST_USER_INFO_REQUEST = 11;
    public static final int CID_BUDDY_LIST_REMOVE_SESSION_REQ = 12;
    public static final int CID_BUDDY_LIST_REMOVE_SESSION_RES = 13;
    public static final int CID_BUDDY_LIST_ALL_USER_REQUEST = 14;
    public static final int CID_BUDDY_LIST_ALL_USER_RESPONSE = 15;
    public static final int CID_BUDDY_LIST_USERS_STATUS_REQUEST = 16;
    public static final int CID_BUDDY_LIST_USERS_STATUS_RESPONSE = 17;
    public static final int CID_BUDDY_LIST_DEPARTMENT_REQUEST = 18;
    public static final int CID_BUDDY_LIST_DEPARTMENT_RESPONSE = 19;
    public static final int CID_BUDDY_LIST_MAX = 21;

    public static final int USER_MSG_TYPE = 1;

    public static final int IM_PDU_VERSION = 3;

    // SERVICE_ID
    public static final int SID_LOGIN = 1;
    public static final int SID_BUDDY_LIST = 2;
    public static final int SID_MSG = 3;
    public static final int SID_SWITCH_SERVER = 4;
    public static final int SID_GROUP = 5;
    public static final int SID_FILE = 6;
    public static final int SID_OTHER = 7;
    public static final int SID_DEFAULT = 7;

    // todo eric, make the value enum, so if adding new sid, no need to change
    // the value for max
    public static final int SID_MAX = 0x0010;

    // LOGIN IP,PORT
    public static final String LOGIN_IP1 = "192.168.1.63";
    public static final String LOGIN_IP2 = "127.0.0.1";
    //open source
    public static final int LOGIN_PORT = 8000;

    // COMMAND_ID FOR LOGIN
    public static final int CID_LOGIN_REQ_MSGSERVER = 1;
    public static final int CID_LOGIN_RES_MSGSERVER = 2;
    public static final int CID_LOGIN_REQ_USERLOGIN = 3;
    public static final int CID_LOGIN_RES_USERLOGIN = 4;
    public static final int CID_LOGIN_REQ_LOGINOUT = 5;
    public static final int CID_LOGIN_RES_LOGINOUT = 6;
    public static final int CID_LOGIN_KICK_USER = 7;
    public static final int CID_LOGIN_MAX = 10;

    // CONTACT
    public static final int CID_REQUEST_RECNET_CONTACT = 1;

    public static final int CID_GET_USER_INFO_REQUEST = 11;// 请求用户信息

    public static final int CID_GET_USER_INFO_RESPONSE = 10;// 获取用户信息

    public static  final int CID_BUDDY_LIST_EMPLOYEE_REQUEST	= 18;

    public static final int CID_BUDDY_LIST_EMPLOYEE_RESPONSE	= 19;



    public static final int ON_LINE = 1;
    // COMMAND_ID FOR MSG
//    public static final int CID_MSG_DATA = 1;
    public static final int CID_MSG_DATA_ACK = 2;
    public static final int CID_MSG_READ_ACK = 3;
    public static final int CID_MSG_TIME_REQUEST = 5;
    public static final int CID_MSG_TIME_RESPONSE = 6;
    public static final int CID_MSG_UNREAD_CNT_REQUEST = 7;
    public static final int CID_MSG_UNREAD_CNT_RESPONSE = 8;
    public static final int CID_MSG_UNREAD_MSG_REUQEST = 9;
    public static final int CID_MSG_HISTORY_MSG_REQUEST = 10;
    // public static final int CID_MSG_LIST_RESPONSE = 11;
    public static final int CID_MSG_HISTORY_SERVICE_MSG_REQUEST = 12;
    public static final int CID_MSG_HISTORY_SERVICE_MSG_RESPONSE = 13;

    public static final int CID_MSG_UNREAD_MSG_RESPONSE = 14;
    public static final int CID_MSG_HISTORY_MSG_RESPONSE = 15;
    public static final int CID_MSG_MAX = 17;

    public static final int CID_SHOP_MEMBER_RESPONSE = 2;
    public static final int CID_CONTACT_RECENT_RESPONSE = 3;
    public static final int CID_CONTACT_FRIEND_STATUS_NOTIYF = 5;
    public static final int CID_QUERY_USER_ONLINE_STATUS_REQUEST = 8;
    public static final int CID_QUERY_USER_ONLINE_STATUS_RESPONSE = 9;

    public static final int CID_HEART_BEAT = 1;

    public static final int RES_RESULT_SUCCESS = 0;

    public static final int CLIENT_TYPE = 0x12;// 表示android，登陆消息服务器时使用

    public static final String CLIENT_VERSION = "ANDROID_YIM_V1.0.1";
}
